import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { HomeComponent } from './home/home.component';
import { WelcomeComponent } from './welcome/welcome.component';
import { ArticleComponent } from './home/article/article.component';
import { ArtistComponent } from './home/artist/artist.component';
import { MainComponent } from './home/main/main.component';
import { MessageComponent } from './home/message/message.component';
import { ArticleClassComponent } from './home/article/article-class/article-class.component';
const routes: Routes = [
  {
    path:'',
    redirectTo:'/welcome',
    pathMatch:'full'
  },{
    path:'home',
    component:HomeComponent,
    children:[{
      path:'main',
      component:MainComponent
    },{
      path:'article',
      component:ArticleComponent
    },{
      path:'artist',
      component:ArtistComponent
    },{
      path:'message',
      component:MessageComponent
    },{
      path:'class',
      component:ArticleClassComponent
    }]
  },{
    path:'welcome',
    component:WelcomeComponent
  }
];

@NgModule({
  imports: [RouterModule.forRoot(routes)],
  exports: [RouterModule]
})
export class AppRoutingModule { }
